import request from '@/utils/request';

// 查询商品规格列表
export function listSpecification(query) {
	return request({
		url: '/mall/specification/list',
		method: 'post',
		data: query,
	});
}

// 查询商品规格详细
export function getSpecification(id) {
	return request({
		url: '/mall/specification/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增商品规格
export function addSpecification(data) {
	return request({
		url: '/mall/specification/add',
		method: 'post',
		data: data,
	});
}

// 编辑商品规格
export function updateSpecification(data) {
	return request({
		url: '/mall/specification/edit',
		method: 'post',
		data: data,
	});
}

// 删除商品规格
export function delSpecification(id) {
	return request({
		url: '/mall/specification/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出商品规格
export function exportSpecification(query) {
	return request({
		url: '/mall/specification/export',
		method: 'post',
		params: query,
	});
}
